package com.cxm.report.model.data;

import lombok.Data;

import java.math.BigDecimal;
import java.math.RoundingMode;

/**
 * @author scl.BlueOcean
 * @version 1.0
 * @date 2018年07月03 15:01
 * @description 报告详情
 */
@Data
public class ReportDetail {
    private String reportDate;
    //环比
    private Double ringRatio;

    private int orderNum;
    private int successNum;
    private int overTimeNum;
    private int noRecordNum;
    private int inquiryNum;
    private int failedNum;
    public void setRingRatio(Double ringRatio){
        try {
            this.ringRatio = new BigDecimal(ringRatio).setScale(2, RoundingMode.UP).doubleValue();
        } catch (Exception e) {}
    }

    public String getSuccessPercent(){
        try {
            return new BigDecimal(successNum*100.0/orderNum).setScale(2, RoundingMode.UP).doubleValue()+"%";
        } catch (Exception e) {}
        return null;
    }
}
